﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 数组_交错数组
{
    class Program
    {
        static void Main(string[] args)
        {
            //int[][] arr;  //定义交错数组变量
            //arr = new int[3][];  //创建交错数组对象
            //arr[0] = new int[2];  //创建数组的第0个内部数组
            //arr[0][2] = 3;  //第0个数组的第2个元素赋值为3

            //简写
            int[][] arry =
            {
                new int[]{2,5,4},
                new int[]{3,9,12},
                new int[]{2,4,6,2},
                new int[]{2,3}
            };

            //遍历
            for (int r = 0; r < arry.Length; r++)//外层数组
            {
                for (int w = 0; w < arry[r].Length; w++)  //内层数组
                {
                    Console.Write(arry[r][w] + "\t");
                }
                Console.WriteLine();
            }
        }
    }
}
